package com.company.service.impl;

import com.company.entity.User;
import com.company.service.LoginService;

import java.util.List;
import java.util.Scanner;

public class LoginServiceImpl extends User implements LoginService {

    @Override
    public void execute(List list) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入账户");
        String name= sc.next();
        System.out.println("输入密码");
        String mima= sc.next();
        for (int i = 0; i < list.size(); i++) {
            User user= (User) list.get(i);

            if (name.equals(user.getUsername()) && mima.equals(user.getPassword())){
                System.out.println("成功");
                xiaosuoimpl xiaosuoimpl=new xiaosuoimpl();
                xiaosuoimpl.execute(list);
                break;
            }
            System.out.println("没有该账户");
        }


    }

}